// 模拟用户登录接口
export default [
  {
    url: '/admin/admin/login',
    method: 'post',
    response: ({ body }) => {
      const { adminname, password } = body

      // 简单的验证逻辑
      if (adminname === 'admin' && password === '123456') {
        return {
          code: '200',
          message: '登录成功',
          data: {
            token: new Date().getTime(),
            userInfo: {
              id: new Date().getTime(),
              adminname: adminname,
              name: new Date().getTime(),
              role: 'admin',
              createTime: new Date().getTime(),
            },
          },
        }
      } else {
        return {
          code: '400',
          message: '用户名或密码错误',
          data: null,
        }
      }
    },
  },

  // 模拟获取用户列表接口
  {
    url: '/admin/admin/list',
    method: 'get',
    response: () => {
      const users = [
        {
          id: '1001',
          adminname: 'zhangsan',
          name: '张三',
          email: 'zhangsan@example.com',
          phone: '13800138001',
          role: 'admin',
          status: 'active',
          createTime: '2024-01-15 09:30:00',
          updateTime: '2024-09-10 14:20:00',
          avatar: 'https://via.placeholder.com/100x100/4A90E2/FFFFFF?text=张',
        },
        {
          id: '1002',
          adminname: 'lisi',
          name: '李四',
          email: 'lisi@example.com',
          phone: '13800138002',
          role: 'user',
          status: 'active',
          createTime: '2024-02-20 10:15:00',
          updateTime: '2024-09-08 16:45:00',
          avatar: 'https://via.placeholder.com/100x100/50C878/FFFFFF?text=李',
        },
        {
          id: '1003',
          adminname: 'wangwu',
          name: '王五',
          email: 'wangwu@example.com',
          phone: '13800138003',
          role: 'editor',
          status: 'inactive',
          createTime: '2024-03-10 14:25:00',
          updateTime: '2024-08-30 11:10:00',
          avatar: 'https://via.placeholder.com/100x100/FF6B6B/FFFFFF?text=王',
        },
        {
          id: '1004',
          adminname: 'zhaoliu',
          name: '赵六',
          email: 'zhaoliu@example.com',
          phone: '13800138004',
          role: 'user',
          status: 'active',
          createTime: '2024-04-05 16:40:00',
          updateTime: '2024-09-05 09:30:00',
          avatar: 'https://via.placeholder.com/100x100/FFD93D/FFFFFF?text=赵',
        },
        {
          id: '1005',
          adminname: 'sunqi',
          name: '孙七',
          email: 'sunqi@example.com',
          phone: '13800138005',
          role: 'admin',
          status: 'active',
          createTime: '2024-05-12 08:20:00',
          updateTime: '2024-09-09 15:55:00',
          avatar: 'https://via.placeholder.com/100x100/A8E6CF/FFFFFF?text=孙',
        },
        {
          id: '1006',
          adminname: 'zhouba',
          name: '周八',
          email: 'zhouba@example.com',
          phone: '13800138006',
          role: 'editor',
          status: 'active',
          createTime: '2024-06-18 13:10:00',
          updateTime: '2024-09-07 12:25:00',
          avatar: 'https://via.placeholder.com/100x100/DDA0DD/FFFFFF?text=周',
        },
        {
          id: '1007',
          adminname: 'wujiu',
          name: '吴九',
          email: 'wujiu@example.com',
          phone: '13800138007',
          role: 'user',
          status: 'inactive',
          createTime: '2024-07-22 17:35:00',
          updateTime: '2024-08-28 10:15:00',
          avatar: 'https://via.placeholder.com/100x100/F0A500/FFFFFF?text=吴',
        },
        {
          id: '1008',
          adminname: 'zhengshi',
          name: '郑十',
          email: 'zhengshi@example.com',
          phone: '13800138008',
          role: 'admin',
          status: 'active',
          createTime: '2024-08-03 11:45:00',
          updateTime: '2024-09-06 14:30:00',
          avatar: 'https://via.placeholder.com/100x100/87CEEB/FFFFFF?text=郑',
        },
        {
          id: '1009',
          adminname: 'chenyi',
          name: '陈一',
          email: 'chenyi@example.com',
          phone: '13800138009',
          role: 'user',
          status: 'active',
          createTime: '2024-08-15 15:20:00',
          updateTime: '2024-09-04 08:40:00',
          avatar: 'https://via.placeholder.com/100x100/FFB6C1/FFFFFF?text=陈',
        },
        {
          id: '1010',
          adminname: 'liuer',
          name: '刘二',
          email: 'liuer@example.com',
          phone: '13800138010',
          role: 'editor',
          status: 'active',
          createTime: '2024-09-01 12:00:00',
          updateTime: '2024-09-10 16:20:00',
          avatar: 'https://via.placeholder.com/100x100/20B2AA/FFFFFF?text=刘',
        },
      ]

      return {
        code: '200',
        message: '获取成功',
        data: {
          list: users,
          total: users.length,
          page: 1,
          pageSize: 10,
        },
      }
    },
  },
]
